<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Msg extends Model
{
    protected $fillable=[
        'question_id','source_id','target_id', 'operate'
    ];
    //发出消息的用户
    public function byUser()
    {
        return $this->belongsTo("App\User",'source_id','');
    }
    //消息所属的文章
    public function question()
    {
        return $this->belongsTo("App\Question");
    }
}
